<?php namespace Summer\Easypay\Updates;

use Schema;
use Winter\Storm\Database\Updates\Migration;

class BuilderTableCreateSummerEasypayRecord extends Migration
{
    public function up()
    {
        Schema::create('summer_easypay_record', function($table)
        {
            $table->engine = 'InnoDB';
            $table->increments('id')->unsigned();
            $table->timestamp('created_at')->nullable();
            $table->timestamp('updated_at')->nullable();
            $table->integer('user_id');
            $table->string('scene')->nullable();
            $table->string('gateway')->nullable();
            $table->string('method')->nullable();
            $table->dateTime('pay_at')->nullable();
            $table->integer('is_pay')->nullable()->default(0);
            $table->text('params')->nullable();
            $table->decimal('money', 14, 2)->nullable();
            $table->integer('table_id')->nullable();
            $table->string('table_name')->nullable();
        });
    }
    
    public function down()
    {
        Schema::dropIfExists('summer_easypay_record');
    }
}
